package com.ruoyi.credential.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.credential.domain.KwUserCredential;
import com.ruoyi.credential.mapper.KwUserCredentialMapper;
import com.ruoyi.credential.service.IKwUserCredentialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 密码箱凭证关联资源表Service业务层处理
 * 
 * @author gonianer
 * @date 2023-11-16
 */
@Service
public class KwUserCredentialServiceImpl implements IKwUserCredentialService
{
    @Autowired
    private KwUserCredentialMapper kwUserCredentialMapper;

    /**
     * 查询密码箱凭证关联资源表
     * 
     * @param id 密码箱凭证关联资源表主键
     * @return 密码箱凭证关联资源表
     */
    @Override
    public KwUserCredential selectKwUserCredentialById(Long id)
    {
        return kwUserCredentialMapper.selectKwUserCredentialById(id);
    }

    @Override
    public KwUserCredential selectKwUserPasswdById(Long id){
        return kwUserCredentialMapper.selectKwUserPasswdById(id);
    }

    /**
     * 查询密码箱凭证关联资源表列表
     * 
     * @param kwUserCredential 密码箱凭证关联资源表
     * @return 密码箱凭证关联资源表
     */
    @Override
    public List<KwUserCredential> selectKwUserCredentialList(KwUserCredential kwUserCredential)
    {
        return kwUserCredentialMapper.selectKwUserCredentialList(kwUserCredential);
    }

    /**
     * 新增密码箱凭证关联资源表
     * 
     * @param kwUserCredential 密码箱凭证关联资源表
     * @return 结果
     */
    @Override
    public int insertKwUserCredential(KwUserCredential kwUserCredential)
    {
        kwUserCredential.setCreateTime(DateUtils.getNowDate());
        return kwUserCredentialMapper.insertKwUserCredential(kwUserCredential);
    }

    /**
     * 修改密码箱凭证关联资源表
     * 
     * @param kwUserCredential 密码箱凭证关联资源表
     * @return 结果
     */
    @Override
    public int updateKwUserCredential(KwUserCredential kwUserCredential)
    {
        kwUserCredential.setUpdateTime(DateUtils.getNowDate());
        return kwUserCredentialMapper.updateKwUserCredential(kwUserCredential);
    }

    /**
     * 批量删除密码箱凭证关联资源表
     * 
     * @param ids 需要删除的密码箱凭证关联资源表主键
     * @return 结果
     */
    @Override
    public int deleteKwUserCredentialByIds(Long[] ids)
    {
        return kwUserCredentialMapper.deleteKwUserCredentialByIds(ids);
    }

    /**
     * 删除密码箱凭证关联资源表信息
     * 
     * @param id 密码箱凭证关联资源表主键
     * @return 结果
     */
    @Override
    public int deleteKwUserCredentialById(Long id)
    {
        return kwUserCredentialMapper.deleteKwUserCredentialById(id);
    }
}
